{include file="header.html"}
<style>
.fot{ text-align: center;background: none;}
</style>
<div class="page-header">
	<h6>
		会员管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			减员申请
		</small>
		<div>
			<a href="javascript:void(0)" mark="import" class="dialog" skip="check">导入申请表</a>
			<a href="javascript:void(0)" mark="export" class="dialog" skip="check">导出申请表</a>
		</div>
	</h6>
</div>

<form class="form-inline" action="?" method="get">
<input type="hidden" name="app" id="app" value="member" />
<input type="hidden" name="act" id="act" value="person_reduce" />
<input type="hidden" name="export" id="export" value="" />
<input type="text" class="input-medium" name="id" value="{$id}" placeholder="ID" />
<input type="text" name="name" value="{$name}" placeholder="减员姓名" />
<input type="text" name="begin_time" id="begin_time" value="{$begin_time}" placeholder="范围开始时间" />
<span class="some-span">-</span>
<input type="text" name="end_time" id="end_time" value="{$end_time}" placeholder="范围结束时间" />
<select name="status" id="status">
<option value="">状态</option>
<option value="1" {if $status=='1'}selected{/if}>同意</option>
<option value="-1" {if $status=='-1'}selected{/if}>不同意</option>
<option value="0" {if $status=='0'}selected{/if}>未审核</option>
</select>
<button type="submit" class="btn btn-info btn-sm">
	<i class="ace-icon fa fa-search bigger-110"></i>搜索
</button>
</form>

<form action="?app=member&act=person_reduce_check_cate" method="post" id="tochange" enctype="multipart/form-data">
<input type="hidden" name="cate_type" id="cate_type" />
<div class="table-content">
<table id="simple-table" class="table table-striped table-bordered table-hover">
	<thead>
		<tr>
			<th>ID</th>
			<th>申请人</th>
			<th>减员列表</th>
			<th>状态</th>
			<th>申请时间</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		{foreach from=$rs item=row}
		<tr>
			<td>{$row->id}</td>
			<td><a href="?app=member&act=person_reduce_edit&id={$row->id}">{$row->member_name}</a></td>
			<td>{$row->persons}</td>
			<td>{if $row->status==1}同意{elseif $row->status==-1}不同意{else}未审核{/if}</td>
			<td>{$row->add_time|date_format:"%Y-%m-%d"}</td>
			<td>
				<a href="?app=member&act=person_reduce_edit&id={$row->id}">
					<button type="button" class="btn btn-xs btn-info">
					<i class="ace-icon fa fa-pencil bigger-120"></i>
					</button>
				</a>
				<a href="?app=member&act=person_reduce_delete&id={$row->id}" class="delete">
					<button type="button" class="btn btn-xs btn-danger">
					<i class="ace-icon fa fa-trash-o bigger-120"></i>
					</button>
				</a>
			</td>
		</tr>
		{foreachelse}
		<tr bgcolor="white"><td colspan="13" height="50">暂无记录</td></tr>
		{/foreach}	
		
	</tbody>
</table>
</div>

<div class="modal fade" id="to-import" role="dialog" aria-labelledby="gridSystemModalLabel">
	<div class="modal-dialog row" role="document" style="margin-top:8%;">
		<div class="modal-content col-lg-8 col-lg-offset-2">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			</div>
			<div class="modal-body">
				<div class="container-fluid">
					选择Excel表：<input type="file" name="file" id="file" style="display:inline-block;width:200px;" />
				</div>
			</div>
			<div class="modal-footer fot">
				<button type="button" class="btn" data-dismiss="modal"> 取消 </button>
				<button type="button" class="btn get-to import"> 提交 </button>
			</div>
		</div>
	</div>
</div>
</form>

<div class="mypage">
	共 {$page.num_records} 个记录  {$page.current_page} / {$page.num_pages} 页  {$page.first_page} {$page.prev} {$page.nav} {$page.next} {$page.last_page}
</div>
{include file="footer.html"}
<script>
$(function(){
	$('#begin_time').datepicker();
	$('#end_time').datepicker();
	$('.page-header .dialog').click(function(){
		//if(!!!$(this).attr('skip') && !$('.checkbox:checked').length){ alert('请选择需要修改的记录');return }
		var mark = $(this).attr('mark');
		if(mark=='export'){
			$('#export').val(1);
			$('form.form-inline').submit();
			setTimeout(function(){ $('#export').val('') }, 10);
			return;
		}
		$('#cate_type').val(mark);
		$('#to-'+mark).modal();
	});
	$('.get-to').click(function(){
		var model = $(this).parents('.modal').eq(0), id = model.attr('id');
		switch(id){
			case 'to-import':
				if(!model.find('#file').val().length){ alert('请选择需要导入的Excel文件');return }
				break;
		}
		$('#tochange').submit();
	});
});
</script>